Replace custom CLI with argparse - #83
Conversation
| ) | ||
|
|
||
| def add_subcommand(name: str, doc: str) -> argparse.ArgumentParser: | ||
| doc = doc.strip() |
There was a problem hiding this comment.
Won't strip only strip the first line? I suggest using inpect.cleandoc instead.
|
|
||
|
|
||
|
|
||
| ### blurb help |
There was a problem hiding this comment.
I'd suggest keeping at least a little note pointing to --help.
|
When this lands I think it'll be time for a release, we haven't had any for quite some time (and, to be honest that "in in" is bugging me now ;-). I'm happy to take care of it then. |
hugovk
left a comment
There was a problem hiding this comment.
When this lands I think it'll be time for a release, we haven't had any for quite some time (and, to be honest that "in in" is bugging me now ;-). I'm happy to take care of it then.
Yes, I think it's time, go for it!
https://github.com/python/blurb/blob/main/CHANGELOG.md shows 2.1.0 and 2.2.0 but neither has been released yet, so they need merging as 2.1.0.
And https://github.com/python/blurb/blob/main/.github/release.yml needs to update dependabot to dependabot[bot].
StanFromIreland
left a comment
There was a problem hiding this comment.
One little nit, otherwise looks good!
| @@ -64,10 +64,8 @@ managers. | |||
|
|
|||
| ### blurb help | |||
There was a problem hiding this comment.
This shouldn't be under "blurb subcommands" if we're deprecating it, maybe rename to "Getting help".
There's a lot of custom code for the CLI handling, which we can replace with argparse.
This saves us about 150 lines of code, and we get colour help, plus I've added backticks in some help messages for "code" formatting as well.
Right now, blurb has both subcommand and option versions of help and version:
This PR deprecates the subcommands in favour of the more ususal options.